﻿<ad:DocumentContent x:Class="WPFToolboxForSiemensPLCs.DockableWindows.ContentWindowDiffWindow"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
                    xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
                    xmlns:avalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:Document="clr-namespace:ICSharpCode.AvalonEdit.Document;assembly=ICSharpCode.AvalonEdit"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    d:DesignHeight="339"
                    d:DesignWidth="705"
                    mc:Ignorable="d">

    <Grid Grid.IsSharedSizeScope="False">
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition SharedSizeGroup="col1" />
            <ColumnDefinition SharedSizeGroup="col2" />
        </Grid.ColumnDefinitions>

        <Grid Name="mainGridA" Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.3*" SharedSizeGroup="FirstRow" />
                <RowDefinition Height="Auto" />
                <RowDefinition SharedSizeGroup="SecondRow" />
            </Grid.RowDefinitions>
            <Grid Name="toppanelA" Grid.Row="0">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TreeView Name="myTreeA"
                          Grid.Column="0"
                          AllowDrop="True"
                          Drop="myTreeA_Drop"
                          ItemsSource="{Binding}"
                          SelectedItemChanged="myTreeA_SelectedItemChanged">
                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <TextBlock Text="{Binding Name}" />
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
                <GridSplitter Grid.Column="0" Width="5" />
                <DataGrid Name="myDGridA"
                          Grid.Column="1"
                          AllowDrop="True"
                          AutoGenerateColumns="False"
                          DockPanel.Dock="Right"
                          Drop="myDGridA_Drop"
                          ItemsSource="{Binding Children}">
                    <DataGrid.Columns>
                        <!--
                            <DataGridTextColumn Header="ID" Width="SizeToCells"
                            Binding="{Binding Id}"
                            CanUserSort="False"
                            IsReadOnly="True"/>
                            <DataGridTextColumn Header="Type"
                            Binding="{Binding Date, StringFormat=d}"
                            CanUserSort="False" />
                        -->
                        <DataGridTextColumn MinWidth="30"
                                            Binding="{Binding IsArray}"
                                            CanUserSort="False"
                                            Header="Array" />
                        <DataGridTextColumn MinWidth="30"
                                            Binding="{Binding ArrayStart}"
                                            CanUserSort="False"
                                            Header="ArrSt" />
                        <DataGridTextColumn MinWidth="30"
                                            Binding="{Binding ArrayStop}"
                                            CanUserSort="False"
                                            Header="ArrStp" />
                        <DataGridTextColumn MinWidth="100"
                                            Binding="{Binding Name}"
                                            CanUserSort="False"
                                            Header="Name" />
                        <DataGridTextColumn MinWidth="80"
                                            Binding="{Binding DataType}"
                                            CanUserSort="False"
                                            Header="Datatype" />
                        <DataGridTextColumn MinWidth="80"
                                            Binding="{Binding StartValue}"
                                            CanUserSort="False"
                                            Header="StartValue" />
                        <!--
                            <DataGridTextColumn Header="Adress" MinWidth="60"
                            Binding="{Binding Adress}"
                            CanUserSort="False"
                            IsReadOnly="True"
                            />
                        -->
                        <DataGridTextColumn Width="300"
                                            MinWidth="100"
                                            Binding="{Binding Comment}"
                                            CanUserSort="False"
                                            Header="Comment" />
                    </DataGrid.Columns>
                </DataGrid>

            </Grid>
            <GridSplitter Grid.Row="1"
                          Grid.Column="0"
                          Grid.ColumnSpan="2"
                          Width="Auto"
                          Height="5"
                          Margin="0"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          ResizeDirection="Rows" />
            <avalonEdit:TextEditor Name="textEditorA"
                                   Grid.Row="2"
                                   VerticalAlignment="Top"
                                   AllowDrop="True"
                                   DragOver="textEditorA_DragOver"
                                   Drop="textEditorA_Drop"
                                   FontFamily="Consolas"
                                   FontSize="10pt"
                                   ShowLineNumbers="True"
                                   Visibility="Visible" />            
        </Grid>

        <Grid Name="mainGridB" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.3*" SharedSizeGroup="FirstRow" />
                <RowDefinition Height="Auto" />
                <RowDefinition SharedSizeGroup="SecondRow" />
            </Grid.RowDefinitions>
            <Grid Name="toppanelB" Grid.Row="0">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="180" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TreeView Name="myTreeB"
                          Grid.Column="0"
                          AllowDrop="True"
                          Drop="myTreeB_Drop"
                          ItemsSource="{Binding}"
                          SelectedItemChanged="myTreeB_SelectedItemChanged">
                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <TextBlock Text="{Binding Name}" />
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
                <GridSplitter Grid.Column="0" Width="5" />
                <DataGrid Name="myDGridB"
                          Grid.Column="1"
                          AllowDrop="True"
                          AutoGenerateColumns="False"
                          DockPanel.Dock="Right"
                          Drop="myDGridB_Drop"
                          ItemsSource="{Binding Children}">
                    <DataGrid.Columns>
                        <!--
                            <DataGridTextColumn Header="ID" Width="SizeToCells"
                            Binding="{Binding Id}"
                            CanUserSort="False"
                            IsReadOnly="True"/>
                            <DataGridTextColumn Header="Type"
                            Binding="{Binding Date, StringFormat=d}"
                            CanUserSort="False" />
                        -->
                        <DataGridTextColumn MinWidth="30"
                                            Binding="{Binding IsArray}"
                                            CanUserSort="False"
                                            Header="Array" />
                        <DataGridTextColumn MinWidth="30"
                                            Binding="{Binding ArrayStart}"
                                            CanUserSort="False"
                                            Header="ArrSt" />
                        <DataGridTextColumn MinWidth="30"
                                            Binding="{Binding ArrayStop}"
                                            CanUserSort="False"
                                            Header="ArrStp" />
                        <DataGridTextColumn MinWidth="100"
                                            Binding="{Binding Name}"
                                            CanUserSort="False"
                                            Header="Name" />
                        <DataGridTextColumn MinWidth="80"
                                            Binding="{Binding DataType}"
                                            CanUserSort="False"
                                            Header="Datatype" />
                        <DataGridTextColumn MinWidth="80"
                                            Binding="{Binding StartValue}"
                                            CanUserSort="False"
                                            Header="StartValue" />
                        <!--
                            <DataGridTextColumn Header="Adress" MinWidth="60"
                            Binding="{Binding Adress}"
                            CanUserSort="False"
                            IsReadOnly="True"
                            />
                        -->
                        <DataGridTextColumn Width="300"
                                            MinWidth="100"
                                            Binding="{Binding Comment}"
                                            CanUserSort="False"
                                            Header="Comment" />
                    </DataGrid.Columns>
                </DataGrid>

            </Grid>
            <GridSplitter Grid.Row="1"
                          Grid.Column="0"
                          Grid.ColumnSpan="2"
                          Width="Auto"
                          Height="5"
                          Margin="0"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch"
                          ResizeDirection="Rows" />
            <avalonEdit:TextEditor Name="textEditorB"
                                   Grid.Row="2"
                                   VerticalAlignment="Top"
                                   AllowDrop="True"
                                   DragOver="textEditorB_DragOver"
                                   Drop="textEditorB_Drop"
                                   FontFamily="Consolas"
                                   FontSize="10pt"
                                   ShowLineNumbers="True"
                                   Visibility="Visible" />
        </Grid>


        <GridSplitter Grid.Row="1"
                          Grid.Column="0"
                          Grid.ColumnSpan="2"
                          Width="Auto"
                          Height="5"
                          Margin="0"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Top"
                          ResizeDirection="Rows" />
        
        <Grid Grid.Row="1" Grid.ColumnSpan="2">
            
            <Button Name="cmdCompare"
                    Grid.Row="2"
                    Width="79"
                    Margin="0,5,0,0"
                    HorizontalAlignment="Left"
                    Click="cmdCompare_Click"
                    Content="Compare" />

            <avalonedit:TextEditor Grid.Row="2" FontFamily="Consolas"
                                   FontSize="10pt"
                                   ShowLineNumbers="True"                          
                          Margin="85,5,0,0" Name="txtResult">
            </avalonedit:TextEditor>
        </Grid>

    </Grid>


</ad:DocumentContent>
